package top.zsyle.sycc.fallback;


import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import top.zsyle.sycc.exception.GlobalExceptionEnum;
import top.zsyle.sycc.feign.CourseMarketService;
import top.zsyle.sycc.feign.CourseService;
import top.zsyle.sycc.result.JsonResult;

@Component
public class CourseFallbackFactory implements FallbackFactory<CourseService> {

    @Override
    public CourseService create(Throwable throwable) {
        return new CourseService() {
            @Override
            public JsonResult info(String courseIds) {
                return JsonResult.error(GlobalExceptionEnum.ERROR.getMessage(),GlobalExceptionEnum.ERROR.getCode());
            }
        };
    }
}
